package org.goobs.database;

import java.util.HashMap;
import java.util.Map;

public class GenericDatabaseRow implements DatabaseRow{

	private Map <String, Object> contents = new HashMap <String, Object> ();
	
	public void setContents(HashMap <String, Object> contents){
		this.contents = contents;
	}
	
	public Object getObject(String key){
		return contents.get(key);
	}
	
	@Override
	public Map<String, Object> export() {
		return contents;
	}

	@Override
	public void load(Map<String, Object> row) {
		contents = row;
	}

	public String toString(){
		String rtn = "( ";
		for(String key : contents.keySet()){
			rtn = rtn + key + ":" + contents.get(key) + " ";
		}
		rtn = rtn + ")";
		return rtn;
	}
}
